package net.vkits.api;

import io.swagger.annotations.*;
import net.vkits.common.dto.BaseDTO;
import net.vkits.common.dto.JwtToken;
import net.vkits.common.dto.LoginUser;
import net.vkits.common.dto.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2016-10-27T05:49:23.577Z")

@Api(value = "user", description = "the user API")
@RequestMapping("/api/v2")
public interface UserApi {

    @ApiOperation(value = "更换手机号码", notes = "更换手机号码", response = BaseDTO.class, tags = {"user",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Authentication was successful", response = BaseDTO.class),
            @ApiResponse(code = 400, message = "Invalid username/password supplied", response = BaseDTO.class)})
    @RequestMapping(value = "/user/changephone",
            produces = {"application/json"},
            method = RequestMethod.POST)
    ResponseEntity<BaseDTO> changeCellphoneNumber(

            @ApiParam(value = "更换手机号码", required = true) @RequestBody LoginUser body

    );


    @ApiOperation(value = "Get user info", notes = "This can only be done by the logged in user.", response = User.class, tags = {"user",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "return User info", response = User.class),
            @ApiResponse(code = 404, message = "User not found", response = User.class)})
    @RequestMapping(value = "/user",
            produces = {"application/json"},
            method = RequestMethod.GET)
    ResponseEntity<User> getUser();

    @ApiOperation(value = "Delete user info", notes = "This can only be done by the logged in user.", response = BaseDTO.class, tags = {"user",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "return 200 OK", response = BaseDTO.class),
            @ApiResponse(code = 404, message = "User not found", response = BaseDTO.class)})
    @RequestMapping(value = "/user",
            produces = {"application/json"},
            method = RequestMethod.DELETE)
    ResponseEntity<BaseDTO> deleteUser();


    @ApiOperation(value = "用户登录", notes = "用户登录", response = JwtToken.class, authorizations = {
            @Authorization(value = "Bearer")
    }, tags = {"user",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Authentication was successful", response = JwtToken.class),
            @ApiResponse(code = 400, message = "Invalid username/password supplied", response = JwtToken.class)})
    @RequestMapping(value = "/user/login",
            produces = {"application/json"},
            method = RequestMethod.POST)
    ResponseEntity<JwtToken> loginUser(

            @ApiParam(value = "The user obj for login", required = true) @RequestBody LoginUser body

    );


    @ApiOperation(value = "Updated user avatar", notes = "This can only be done by the logged in user.", response = BaseDTO.class, tags = {"user",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "OK", response = BaseDTO.class),
            @ApiResponse(code = 400, message = "Invalid user supplied", response = BaseDTO.class),
            @ApiResponse(code = 404, message = "User not found", response = BaseDTO.class)})
    @RequestMapping(value = "/user",
            produces = {"application/json"},
            method = RequestMethod.PUT)
    ResponseEntity<BaseDTO> updateUser(@ApiParam(value = "Updated user name", required = true) @RequestParam(value = "name", required = true) String name


            , @ApiParam(value = "Updated user id number", required = true) @RequestParam(value = "idnumber", required = true) String idnumber


    );


    @ApiOperation(value = "updates user's avatar image", notes = "updates user's avatar image", response = BaseDTO.class, tags = {"user",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "OK", response = BaseDTO.class)})
    @RequestMapping(value = "/user/avatar/upload",
            consumes = {"multipart/form-data"},
            method = RequestMethod.POST)
    ResponseEntity<BaseDTO> userAvatarUploadPost(


            @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file
    );


    @ApiOperation(value = "updates user's idcard image", notes = "updates user's idcard image", response = BaseDTO.class, tags = {"user",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "OK", response = BaseDTO.class)})
    @RequestMapping(value = "/user/idcard/upload",
            consumes = {"multipart/form-data"},
            method = RequestMethod.POST)
    ResponseEntity<BaseDTO> userIdcardUploadPost(


            @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file1
            ,


            @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file2
    );


    @ApiOperation(value = "发送验证码", notes = "发送验证码", response = BaseDTO.class, authorizations = {
            @Authorization(value = "Bearer")
    },tags = {"user",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "OK", response = BaseDTO.class),
            @ApiResponse(code = 400, message = "Too Many Times", response = BaseDTO.class)})
    @RequestMapping(value = "/user/smscode",
            produces = {"application/json"},
            method = RequestMethod.GET)
    ResponseEntity<BaseDTO> userSmscodeGet(@ApiParam(value = "发送验证码", required = true) @RequestParam(value = "cellPhone", required = true) String cellPhone


    );

}
